home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / stasplit / stasplit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.8 KB  |  115 lines

  1. // stasplit.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "stasplit.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "staspdoc.h"
  9. #include "staspvw.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CStaticSplitApp
  18.  
  19. BEGIN_MESSAGE_MAP(CStaticSplitApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CStaticSplitApp)
  21.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // The one and only CStaticSplitApp object
  29.  
  30. CStaticSplitApp theApp;
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CStaticSplitApp initialization
  34.  
  35. BOOL CStaticSplitApp::InitInstance()
  36. {
  37.     // Register the application's document templates.  Document templates
  38.     //  serve as the connection between documents, frame windows and views.
  39.  
  40.     CSingleDocTemplate* pDocTemplate;
  41.     pDocTemplate = new CSingleDocTemplate(
  42.         IDR_MAINFRAME,
  43.         RUNTIME_CLASS(CStaticSplitDoc),
  44.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  45.         RUNTIME_CLASS(CStaticSplitView));
  46.     AddDocTemplate(pDocTemplate);
  47.  
  48.     // create a new (empty) document
  49.     OnFileNew();
  50.  
  51.     return TRUE;
  52. }
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CAboutDlg dialog used for App About
  56.  
  57. class CAboutDlg : public CDialog
  58. {
  59. public:
  60.     CAboutDlg();
  61.  
  62. // Dialog Data
  63.     //{{AFX_DATA(CAboutDlg)
  64.     enum { IDD = IDD_ABOUTBOX };
  65.     //}}AFX_DATA
  66.  
  67. // Implementation
  68. protected:
  69.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  70.     //{{AFX_MSG(CAboutDlg)
  71.     virtual BOOL OnInitDialog();
  72.     //}}AFX_MSG
  73.     DECLARE_MESSAGE_MAP()
  74. };
  75.  
  76. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  77. {
  78.     //{{AFX_DATA_INIT(CAboutDlg)
  79.     //}}AFX_DATA_INIT
  80. }
  81.  
  82. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  83. {
  84.     CDialog::DoDataExchange(pDX);
  85.     //{{AFX_DATA_MAP(CAboutDlg)
  86.     //}}AFX_DATA_MAP
  87. }
  88.  
  89. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  90.     //{{AFX_MSG_MAP(CAboutDlg)
  91.         // No message handlers
  92.     //}}AFX_MSG_MAP
  93. END_MESSAGE_MAP()
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CAboutDlg message handlers
  97.  
  98. BOOL CAboutDlg::OnInitDialog() 
  99. {
  100.     CDialog::OnInitDialog();
  101.     CenterWindow();    
  102.     return TRUE;  // return TRUE unless you set the focus to a control
  103.                   // EXCEPTION: OCX Property Pages should return FALSE
  104. }
  105.  
  106. // App command to run the dialog
  107. void CStaticSplitApp::OnAppAbout()
  108. {
  109.     CAboutDlg aboutDlg;
  110.     aboutDlg.DoModal();
  111. }
  112.  
  113. /////////////////////////////////////////////////////////////////////////////
  114. // CStaticSplitApp commands
  115.